from django.db import models

# Create your models here.
class User(models.Model):
    username = models.CharField('用户名',max_length=20,unique=True)
    password = models.CharField('密码',max_length=20)
    email = models.EmailField('邮箱',max_length=30)
    birthday = models.DateField('生日')
    img_url = models.CharField('头像地址',max_length=255,default='')
    count = models.IntegerField('用户发布的博客数量',default=0)
    class Meta:
        db_table = 'user'


class Friend(models.Model):
    user = models.ForeignKey('User',on_delete=models.CASCADE)
    other_id = models.IntegerField('别人的账户')


    class Meta:
        db_table = 'friend'
